<template>
  <div>
    <Add></Add>
    <hr>
    <Sub></Sub>
    <hr>
    <p>{{$store.state.user.token}}</p>
    <!-- 命名空间/key  -->
    <p>{{$store.getters['user/num']}}</p>
    <button @click="$store.commit('user/fn','yellow')">添加数组一项</button>
    <button @click="$store.dispatch('user/fnAsync')">按钮</button>
  </div>
</template>

<script>
import Add from '@/components/Add.vue'
import Sub from '@/components/Sub.vue'
export default {
  components: {
    Add,
    Sub
  },
  data () {
    return {}
  },
  methods: {}
}
</script>

<style scoped></style>
